﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Configuration.Install;
using System.ServiceProcess;

namespace MyServiceShell
{
    [RunInstaller(true)]
    public partial class HostServiceInstaller : Installer
    {
        public HostServiceInstaller()
        {
            InitializeComponent();
        }

        public void SetInstallers()
        {
            ServiceProcessInstaller processInstaller = new ServiceProcessInstaller();
            processInstaller.Account = ServiceAccount.LocalSystem;

            ServiceInstaller serviceInstaller = new ServiceInstaller();
            serviceInstaller.StartType = ServiceStartMode.Automatic;
            serviceInstaller.ServiceName = "privateSvc";

            this.Installers.Add(serviceInstaller);
            this.Installers.Add(processInstaller);
        }
    }
}
